import 'package:flutter/material.dart';

import './hero_b.dart';

class HeroA extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('飞行动画A'),
      ),
      body: Center(
        child: Container(
          width: 300,
          height: 300,
          child: InkWell(
            child: Column(
              children: <Widget>[
                Hero(
                  tag: 'icon-60',
                  child: ClipOval(
                    child: Image.asset('image/icon-60.png'),
                  ),
                ),
                Padding(
                  padding: EdgeInsets.only(top: 10),
                  child: Text('点击看大图'),
                ),
              ],
            ),
            onTap: () {
              Navigator.of(context).push(PageRouteBuilder(pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
                return FadeTransition(
                  opacity: animation,
                  child: HeroB(),
                );
              }, transitionDuration: Duration(seconds: 1)));
            },
          ),
        ),
      ),
    );
  }
}